<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <body>

        <ui:composition template="./template.xhtml">

            <ui:define name="title">
                Tool Quảng bá
            </ui:define>

            <ui:define name="content">

                <p:tabView activeIndex="#{tabBean.activeIndex}" cache="false" dynamic="true">

                    <!-- tab 0 -->
                    <p:tab title="Black list">
                        <ui:include src="blackList.xhtml"/>
                    </p:tab>

                    <!-- tab 1 -->                    
                    <p:tab title="Drop list">
                        <ui:include src="dropList.xhtml"/>
                    </p:tab>

                    <!-- tab 2 -->                    
                    <p:tab title="Ignore list">
                        <ui:include src="ignoreList.xhtml"/>
                    </p:tab>

                    <!-- tab 3 -->
                    <p:tab title="Lịch sử broadcast">

                        <h:form>
                            <p:dataTable id="broadcastHist" value="#{broadcastHistBean.list}" var="item" paginator="#{broadcastHistBean.list.size() >20}" rows="20" >
                                <p:column headerText="MSISDN" sortBy="#{item.msisdn}" filterBy="#{item.msisdn}" filterMatchMode="contains">
                                    <h:outputText value="#{item.msisdn}"/>
                                </p:column>
                                <p:column headerText="Nội dung" sortBy="#{item.content}" filterBy="#{item.content}" filterMatchMode="contains">
                                    <h:outputText value="#{item.content}"/>
                                </p:column>
                                <p:column headerText="Lần cập nhật cuối" sortBy="#{item.lastUpdateTime}">
                                    <h:outputText value="#{item.lastUpdateTime}">
                                        <f:convertDateTime pattern="dd/MM/yyyy HH:mm:ss" timeZone="Asia/Saigon"/>
                                    </h:outputText>
                                </p:column>
                                <p:column headerText="Trạng thái" sortBy="#{item.status}">
                                    <h:outputText value="#{item.status}"/>
                                </p:column>
                            </p:dataTable>
                            <p:commandButton value="Xuất báo cáo" ajax="false">
                                <p:dataExporter target="broadcastHist" type="xls" fileName="lichsuquangba"/>
                            </p:commandButton>
                        </h:form>
                    </p:tab>

                </p:tabView>


            </ui:define>

        </ui:composition>

    </body>
</html>
